home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _IEFormGetCollection.au3 < prev    next >
Text File  |  2007-09-08  |  2KB  |  40 lines

  1. ; *******************************************************
  2. ; Example 1 - Get a reference to a specific form by 0-based index,
  3. ;                in this case the first form on the page
  4. ; *******************************************************
  5. ;
  6. #include <IE.au3>
  7. $oIE = _IECreate ("http://www.google.com")
  8. $oForm = _IEFormGetCollection ($oIE, 0)
  9. $oQuery = _IEFormElementGetCollection ($oForm, 1)
  10. _IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
  11. _IEFormSubmit ($oForm)
  12.  
  13. ; *******************************************************
  14. ; Example 2 - Get a reference to the collection of forms on a page,
  15. ;                and then loop through them displaying information for each
  16. ; *******************************************************
  17. ;
  18. #include <IE.au3>
  19. $oIE = _IECreate ("http://www.autoitscript.com")
  20. $oForms = _IEFormGetCollection ($oIE)
  21. MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
  22. For $oForm In $oForms
  23.     MsgBox(0, "Form Info", $oForm.name)
  24. Next
  25.  
  26. ; *******************************************************
  27. ; Example 3 - Get a reference to the collection of forms on a page,
  28. ;                and then loop through them displaying information for each
  29. ;                demonstrating use of form index
  30. ; *******************************************************
  31. ;
  32. #include <IE.au3>
  33. $oIE = _IECreate ("http://www.autoitscript.com")
  34. $oForms = _IEFormGetCollection ($oIE)
  35. $iNumForms = @extended
  36. MsgBox(0, "Forms Info", "There are " & $iNumForms & " forms on this page")
  37. For $i = 0 to $iNumForms - 1
  38.     $oForm = _IEFormGetCollection ($oIE, $i)
  39.     MsgBox(0, "Form Info", $oForm.name)
  40. Next